package com.study.zookeeper;

import java.io.*;
import java.net.Socket;

public class MySocketClient {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("127.0.0.1", 2881);
        OutputStream outputStream = null;
        try {
            outputStream = socket.getOutputStream();
            BufferedOutputStream bo = new BufferedOutputStream(outputStream);
            bo.write("4567890".getBytes());
            bo.flush();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (outputStream != null)
                outputStream.close();
            socket.close();
        }
//        InputStream stream = socket.getInputStream();
//        BufferedReader br = new BufferedReader(new InputStreamReader(stream));
//        String s = br.readLine();
//        System.out.println(s);
    }
}
